#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

struct Edge {
    int x, y, w;

    bool operator<(const Edge &e) {
        return w < e.w;
    }
} E[9] = {
        {1, 2, 1},
        {1, 3, 2},
        {2, 3, 6},
        {2, 4, 11},
        {3, 4, 9},
        {3, 5, 13},
        {4, 5, 7},
        {4, 6, 3},
        {5, 6, 4}

};
const int INF=1<<20;
int dis[7][7] = {{0,INF,INF,INF,INF,INF,INF,},
                 {INF,0,1,2,INF,INF,INF,},
                 {INF,1,0,6,11,INF,INF,},
                 {INF,2,6,0,9,13,INF,},
                 {INF,INF,11,9,0,7,3,},
                 {INF,INF,INF,13,7,0,4,},
                 {INF,INF,INF,INF,3,4,0,},
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    for (int i = 0; i <= 6; i++) {
        for (int j = 0; j <= 6; j++) {
            if(i==j)dis[i][j]=0;
            else dis[i][j]=INF;
        }
    }
    for (auto e:E) {
        dis[e.x][e.y] = dis[e.y][e.x] = e.w;
    }
    for (int i = 0; i <= 6; i++) {
        cout << "{";
        for (int j = 0; j <= 6; j++) {
            cout << dis[i][j] << "," ;
        }
        cout << "}," << endl;
    }
    return 0;
}
